package com.ics.model;

import javax.persistence.*;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 11-10-31
 * Time: 下午3:22
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class Supplier extends BaseObject{
    Long id;
    String abbr;
    String code;
    String enName;
    String cnName;
    Boolean status;
    public Supplier(){

    }
    @Column(name = "status", nullable = false)
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    @Column(name = "abbr", nullable = false, length = 50)
    public String getAbbr() {
        return abbr;
    }

    public void setAbbr(String abbr) {
        this.abbr = abbr;
    }
    @Column(name = "code", nullable = false, length = 50)
    public String getCode() {
        return code;
    }
   
    public void setCode(String code) {
        this.code = code;
    }
     @Column(name = "enName", nullable = false, length = 50)
    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Supplier)) return false;

        Supplier supplier = (Supplier) o;

        if (abbr != null ? !abbr.equals(supplier.abbr) : supplier.abbr != null) return false;
        if (cnName != null ? !cnName.equals(supplier.cnName) : supplier.cnName != null) return false;
        if (code != null ? !code.equals(supplier.code) : supplier.code != null) return false;
        if (enName != null ? !enName.equals(supplier.enName) : supplier.enName != null) return false;
        if (id != null ? !id.equals(supplier.id) : supplier.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (abbr != null ? abbr.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (enName != null ? enName.hashCode() : 0);
        result = 31 * result + (cnName != null ? cnName.hashCode() : 0);
        return result;
    }

    @Column(name = "cnName", nullable = false, length = 50)
    public String getCnName() {
        return cnName;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    @Override
    public String toString() {
        return "Supplier{" +
                "id=" + id +
                ", abbr='" + abbr + '\'' +
                ", code='" + code + '\'' +
                ", enName='" + enName + '\'' +
                ", cnName='" + cnName + '\'' +
                '}';
    }
}
